Package com.rnett.action.delegates

Delegation base classes, utilities, and transforms.

Types

Delegatable
Link copied to clipboard
abstract class Delegatable(camelToSnake: Boolean)
MutableDelegatable
Link copied to clipboard
abstract class MutableDelegatable(camelToSnake: Boolean) : Delegatable

Functions

ifNull
Link copied to clipboard
inline fun <D, T : R, R> ReadOnlyProperty<D, T?>.ifNull(crossinline default: () -> R): ReadOnlyProperty<D, R>
Get from the delegate, and return default if the delegate's value is null.
inline fun <D, T> ReadWriteProperty<D, T?>.ifNull(crossinline default: () -> T): ReadWriteProperty<D, T>
Get from the delegate, and return default if the delegate's value is null.
isTrue
Link copied to clipboard
fun <D> ReadOnlyProperty<D, String?>.isTrue(): ReadOnlyProperty<D, Boolean?>
true if the string is equal to "true", non case sensitively.
fun <D> ReadOnlyProperty<D, String>.isTrue(): ReadOnlyProperty<D, Boolean>
true if the string is equal to "true", non case sensitively.
fun <D> ReadWriteProperty<D, String?>.isTrue(): ReadWriteProperty<D, Boolean?>
true if the string is equal to "true", non case sensitively.
fun <D> ReadWriteProperty<D, String>.isTrue(): ReadWriteProperty<D, Boolean>
true if the string is equal to "true", non case sensitively.
lines
Link copied to clipboard
fun <D> ReadOnlyProperty<D, String?>.lines(): ReadOnlyProperty<D, List<String>?>
Get the lines of the string.
fun <D> ReadOnlyProperty<D, String>.lines(): ReadOnlyProperty<D, List<String>>
Get the lines of the string.
fun <D> ReadWriteProperty<D, String?>.lines(writeSeparator: String = "\n"): ReadWriteProperty<D, List<String>?>
Get the lines of the string.
fun <D> ReadWriteProperty<D, String>.lines(writeSeparator: String = "\n"): ReadWriteProperty<D, List<String>>
Get the lines of the string.
lowercase
Link copied to clipboard
fun <D> ReadOnlyProperty<D, String?>.lowercase(): ReadOnlyProperty<D, String?>
fun <D> ReadOnlyProperty<D, String>.lowercase(): ReadOnlyProperty<D, String>
fun <D> ReadWriteProperty<D, String?>.lowercase(): ReadWriteProperty<D, String?>
fun <D> ReadWriteProperty<D, String>.lowercase(): ReadWriteProperty<D, String>
map
Link copied to clipboard
inline fun <D, T, R> ReadOnlyProperty<D, T>.map(crossinline read: (T) -> R): ReadOnlyProperty<D, R>
Map reads from a delegate
inline fun <D, T> ReadWriteProperty<D, T>.map(crossinline read: (T) -> T): ReadWriteProperty<D, T>
Map reads from a delegate
inline fun <D, T, R> ReadWriteProperty<D, T>.map(crossinline read: (T) -> R, crossinline write: (R) -> T): ReadWriteProperty<D, R>
Map reads from and writes to a delegate
mapBoth
Link copied to clipboard
inline fun <D, T> ReadWriteProperty<D, T>.mapBoth(crossinline both: (T) -> T): ReadWriteProperty<D, T>
Map reads from and writes to a delegate
mapBothNonNull
Link copied to clipboard
inline fun <D, T : Any> ReadWriteProperty<D, T?>.mapBothNonNull(crossinline both: (T) -> T): ReadWriteProperty<D, T?>
Map reads from and writes to a delegate if the value is non-null
mapNonNull
Link copied to clipboard
inline fun <D, T : Any, R> ReadOnlyProperty<D, T?>.mapNonNull(crossinline read: (T) -> R): ReadOnlyProperty<D, R?>
Map reads from a delegate if the delegate's value is non-null.
inline fun <D, T : Any> ReadWriteProperty<D, T?>.mapNonNull(crossinline read: (T) -> T): ReadWriteProperty<D, T?>
Map reads from a delegate if the value is non-null
inline fun <D, T : Any, R> ReadWriteProperty<D, T?>.mapNonNull(crossinline read: (T) -> R, crossinline write: (R) -> T): ReadWriteProperty<D, R?>
Map reads from and writes to a delegate if the value is non-null
putIfNull
Link copied to clipboard
inline fun <D, T> ReadWriteProperty<D, T?>.putIfNull(crossinline default: () -> T): ReadWriteProperty<D, T>
Read from the delegate if non-null, otherwise set the delegate to default and return it.
toBoolean
Link copied to clipboard
fun <D> ReadOnlyProperty<D, String?>.toBoolean(): ReadOnlyProperty<D, Boolean?>
true if the string is equal to "true" (non case sensitively), false if it is equal to "false"(non case sensitively), or else throws.
fun <D> ReadOnlyProperty<D, String>.toBoolean(): ReadOnlyProperty<D, Boolean>
true if the string is equal to "true" (non case sensitively), false if it is equal to "false"(non case sensitively), or else throws.
fun <D> ReadWriteProperty<D, String?>.toBoolean(): ReadOnlyProperty<D, Boolean?>
true if the string is equal to "true" (non case sensitively), false if it is equal to "false"(non case sensitively), or else throws.
fun <D> ReadWriteProperty<D, String>.toBoolean(): ReadWriteProperty<D, Boolean>
true if the string is equal to "true" (non case sensitively), false if it is equal to "false"(non case sensitively), or else throws.
toDouble
Link copied to clipboard
fun <D> ReadOnlyProperty<D, String?>.toDouble(): ReadOnlyProperty<D, Double?>
fun <D> ReadOnlyProperty<D, String>.toDouble(): ReadOnlyProperty<D, Double>
fun <D> ReadWriteProperty<D, String?>.toDouble(): ReadWriteProperty<D, Double?>
fun <D> ReadWriteProperty<D, String>.toDouble(): ReadWriteProperty<D, Double>
toFloat
Link copied to clipboard
fun <D> ReadOnlyProperty<D, String?>.toFloat(): ReadOnlyProperty<D, Float?>
fun <D> ReadOnlyProperty<D, String>.toFloat(): ReadOnlyProperty<D, Float>
fun <D> ReadWriteProperty<D, String?>.toFloat(): ReadWriteProperty<D, Float?>
fun <D> ReadWriteProperty<D, String>.toFloat(): ReadWriteProperty<D, Float>
toInt
Link copied to clipboard
fun <D> ReadOnlyProperty<D, String?>.toInt(): ReadOnlyProperty<D, Int?>
fun <D> ReadOnlyProperty<D, String>.toInt(): ReadOnlyProperty<D, Int>
fun <D> ReadWriteProperty<D, String?>.toInt(): ReadWriteProperty<D, Int?>
fun <D> ReadWriteProperty<D, String>.toInt(): ReadWriteProperty<D, Int>
toLong
Link copied to clipboard
fun <D> ReadOnlyProperty<D, String?>.toLong(): ReadOnlyProperty<D, Long?>
fun <D> ReadOnlyProperty<D, String>.toLong(): ReadOnlyProperty<D, Long>
fun <D> ReadWriteProperty<D, String?>.toLong(): ReadWriteProperty<D, Long?>
fun <D> ReadWriteProperty<D, String>.toLong(): ReadWriteProperty<D, Long>
trim
Link copied to clipboard
fun <D> ReadOnlyProperty<D, String?>.trim(): ReadOnlyProperty<D, String?>
fun <D> ReadOnlyProperty<D, String>.trim(): ReadOnlyProperty<D, String>
fun <D> ReadWriteProperty<D, String?>.trim(): ReadWriteProperty<D, String?>
fun <D> ReadWriteProperty<D, String>.trim(): ReadWriteProperty<D, String>
uppercase
Link copied to clipboard
fun <D> ReadOnlyProperty<D, String?>.uppercase(): ReadOnlyProperty<D, String?>
fun <D> ReadOnlyProperty<D, String>.uppercase(): ReadOnlyProperty<D, String>
fun <D> ReadWriteProperty<D, String?>.uppercase(): ReadWriteProperty<D, String?>
fun <D> ReadWriteProperty<D, String>.uppercase(): ReadWriteProperty<D, String>